package com.yuwei.visit.viewmodel

import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.viewModelScope
import com.yuwei.base.BaseViewModel
import com.yuwei.http.ApiService
import com.yuwei.http.entity.VisitEntity
import dagger.hilt.android.lifecycle.HiltViewModel
import kotlinx.coroutines.launch
import javax.inject.Inject

@HiltViewModel
class VisitVIewModel @Inject constructor(
    val apiService: ApiService
): BaseViewModel() {
    val getVisitListSuccess by lazy {
        MutableLiveData<VisitEntity>()
    }
    fun getVisitList() {
        viewModelScope.launch {
            executeNetwork({
                apiService.getVisitList()
            },getVisitListSuccess::postValue)
        }
    }
}